home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
CRS
/
crs56.d81
/
data_def.h
< prev
next >
Wrap
Text File
|
2009-10-10
|
3KB
|
85 lines
/*
─ATAñ─EF.H
═EMORY RESIDENT ─ATAñ┬ASE DEFINITIONS
FOR RUNTIME ALLOCATION IN ├.
THE IDEA HERE IS TO ALLOW A RANGE OF PRE-DEFINED DATA TYPES
TO BE INVOKED AS NEEDED BY A ├ APPLICATION WITH SOME SIMPLE
COMMON SENSE NAMES AND LIMITATIONS.
┬Y ─ENNY ╞IGUERRES
╬╧╘┼: THIS IS JUST A RUN - THRU AND MAY HAVE SYNTAX
ERRORS OR LOGICAL ERRORS IN IT SO CHECK IT OUT AND
LET ME KNOW!
*/
TYPEDEF CHAR BOOLEAN;
TYPEDEF CHAR SEX;
ENUM BOOLEAN █T,F▌;
ENUM INT INTEGER █ -32767 .. +32767 ▌;
TYPEDEF CHAR *STRING[];
TYPEDEF DOUBLE FLOAT;
ENUM SEX █M,F▌;
ENUM INT AGE █1 .. 100▌;
TYPEDEF CHAR *STATE[2];
TYPEDEF DOUBLE PERCENT;
STRUCT PHONE █ /* MAKE ALL OF THESE BE REFERENCED VIA */
CHAR AC[3],PREFX[3],LAST[4]; ▌; /* PTR'S IN THE ACTUAL UNION TAG, SEE */
STRUCT TIME █ /* THE COMMENTS A FEW LINES DOWN AS TO */
CHAR HRS[2],MIN[2],SEC[2],TENTHS[1]; ▌;/* WHY */
STRUCT DATE █
CHAR DD[2],MM[2],YY[2]; ▌;
STRUCT ZIP █
CHAR CODE[5]; ▌;
STRUCT MONEY █
CHAR DOLLARS[9],CENTS[2]; ▌;
UNION DATAñELEMENT █
INTEGER; /* 0 */
STRING; /* 1 *//* A POINTER TO THE STRING NOT THE ACTUAL ARRAY!*/
DATE; /* 2 *//* (TO KEEP THE FINAL STRUCT SMALL) UNION WILL */
TIME; /* 3 *//* ALLOCATE SIZE OF LARGEST MEMBER! */
BOOLEAN;
REAL;
AGE;
SEX;
PHONE;
STATE;
ZIP;
MONEY;
PERCENT; ▌; /* 12 */
STRUCT DATAñREC █
UNSIGNED *DATAñREC; /* NEXT RECORD IN DATA BASE */
UNSIGNED *ELEMENTñLIST; ▌; /* TO 1ST ITEM OF THIS RECORD */
STRUCT ELEMENTñLIST █
UNSIGNED *ELEMENTñLIST; /* LINK ITEMS TO FORM A RECORD */
INT DñTYPEñNUM; /* WHAT TYPE OF ITEM IS THIS? */
UNION DATAñELEMENT; ▌; /* THE ITEM OR THE ADRESS OF IT */
/*
DATA REC IS A LIST OF RECORDS WITH A POINTER TO THE FIRST ELEMENT
OF EACH RECORD.
ELEMENT LIST IS THE ACTUAL RECORD STRUCTURE WITH A POINTER TO THE
NEXT ITEM IN THE RECORD, AN IDENTIFYER OF THIS ITEM'S DATA TYPE,
AND A DATA ITEM WHICH IS ONE OF THE VALID DATA TYPES.
╬╧╘┼: AS ╔ SAID ABOVE THIS IS ╬╧╘ A FUNCTIONAL .H FILE JUST A
FAST RUN-DOWN OF MY IDEA. ╔ LEAVE IT TO OTHERS TO EXAMINE THIS
AND SEE IF THEY LIKE THE IDEA ╔ HAVE, AND IF SO MAKE YOUR OWN
FUNCTIONAL DATA-MODEL. ╔ WROTE THIS IN ABOUT 10 MINUTES AND
DID NOT HAVE TIME TO CHECK MY SYNTAX AS ╔ WENT AT IT.
MABY LATER ╔'LL HAVE TIME AND THEN DO A SHORT DEMO PROGRAM
USING THIS IDEA.
─ENNY ╞IGUERRES
╬OV 27, 1987
1:03 AM
╙TOCKTON ├A.
*/